package com.hongxin.nw.netty.utils;

import com.alibaba.fastjson.JSONObject;

/**
 * @remark --
 * @author: GuoXiaolin
 * @date 2019/6/15 16:06
 * @Version 1.0
 * @Descibe
 */
public class JSONUtils {

    public static final String JSON_CODE = "code";
    public static final String JSON_MSG = "msg";
    public static final String JSON_DATA = "data";

    public static JSONObject getRoot(final int code,final  String msg,final  Object data){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put(JSON_CODE, code);
        jsonObject.put(JSON_MSG, msg);
        jsonObject.put(JSON_DATA,data);
        return jsonObject;
    }
}
